﻿using System.Collections.Generic;

namespace MTPAutoBackup
{
    public class Config
    {
        public string AppName { get; set; }
        public string Version { get; set; }
        public string LocalPath { get; set; }
        public string RemotePathPrefix { get; set; }
        public List<string> BackupPathList { get; set; }
        public List<string> ExclusionList { get; set; }

        // 重写 ToString 方法
        public override string ToString()
        {
            // 这里手动定义每个属性如何展示
            //string RemotePathListStr = RemotePathList != null ? string.Join(", ", RemotePathList) : "null";
            //string ExclusionListStr = ExclusionList != null ? string.Join(", ", ExclusionList) : "null";

            //return $"AppName: {AppName}, Version: {Version}, LocalPath: {LocalPath}, RemotePathList: [{RemotePathListStr}], ExclusionList: [{ExclusionListStr}]";

            return ConfigUtil.SerializeObject(this);
        }
    }
}